#ifndef PARKINGLOTMAINWINDOW_H
#define PARKINGLOTMAINWINDOW_H

#include <QMainWindow>
#include <QSqlDatabase>//用于连接、创建数据库
#include <QSqlQuery>//专用于DML（数据操纵语言）、DDL（数据定义语言）
#include <QSqlQueryModel>
#include <QSqlError>
#include <QtDebug>
#include <QMessageBox>
//摄像头
#include <QCameraImageCapture>
#include <QCamera>
//识别
#include "dialog.h"
#include <QPixmap>
#include "mhttp.h"

QT_BEGIN_NAMESPACE
namespace Ui { class ParkingLotMainWindow; }
QT_END_NAMESPACE

class ParkingLotMainWindow : public QMainWindow
{
    Q_OBJECT

public:
    ParkingLotMainWindow(QWidget *parent = nullptr);
    ~ParkingLotMainWindow();


private slots:

    void on_pushButton_capture_clicked();

    void on_pushButton_count_clicked();

    void on_pushButton__search_clicked();

    void on_pushButton_delete_clicked();

    void on_pushButton_identifiy2_clicked();

    void on_pushButton_identifiy1_clicked();

    //识别
    void on_action_AI_triggered();

    void on_actFromFile_triggered();

    void on_actFromClip_triggered();

    void on_cut(QPixmap p);

    void on_actionaction_C_toggled(bool arg1);

    void on_label_linkActivated(const QString &link);

    void on_shibie();

    void on_pushButton_clicked();

signals:
    void recgFinished();

private://自定义函数
    void CreateDatabaseFunc();//创建SQLite数据库
    void CreateTableFunc();//创建SQLite数据表
    void QueryTableFunc();//执行查询操作
    void onShowUserDb(QString select_sql);//加载数据
    QSqlDatabase sqldb;//创建QT和数据库链接
    QSqlQueryModel sqlmodel;//存储结果集
    void left_car();

private:
    Ui::ParkingLotMainWindow *ui;
    //创建两个摄像头对象
     QCamera *ca;
     QCameraImageCapture *capture;
     Dialog *d;
     const QPixmap *pix;
     bool isCopy2Clip=true;
private:
    void convertPic(QByteArray &arr);
    void copy2Clip();
};
#endif // PARKINGLOTMAINWINDOW_H
